#pragma once

#include "ThreadSchedule.h"
#include "EventLog.h"
#include "afxcmn.h"

// CDlgMain dialog

class CDlgMain : public CDialog
{
	DECLARE_DYNAMIC(CDlgMain)

public:
	CDlgMain(CWnd* pParent = NULL);   // standard constructor
	virtual ~CDlgMain();

// Dialog Data
	enum { IDD = IDD_MAIN };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()
public:
	virtual BOOL OnInitDialog();


protected:	
	HICON					m_hIcon;
	CThreadSchedule*		m_pThread;
	CString					m_sUsr;
	CString					m_sPwd;
	CString					m_sSvr;
	CString					m_sTaskFileName;

	Tasks*					m_pts;			// only used to display tasks description

	CString					m_sRichEditNewContent;
	CRichEditCtrl			m_reOutput;

public:
	afx_msg void	OnBnClickedOk();	
	afx_msg void	OnBnClickedRadioShutdown();
	afx_msg void	OnBnClickedRadioClose();
	afx_msg LRESULT OnTaskSetParamFinished(WPARAM wParam, LPARAM lParam);
	afx_msg LRESULT OnTaskExecState(WPARAM wParam, LPARAM lParam);
	afx_msg LRESULT OnScheduleFinished (WPARAM wParam, LPARAM lParam);
	afx_msg LRESULT OnNewEventLog (WPARAM wParam, LPARAM lParam);
	virtual void OnCancel();
	afx_msg void	OnBnClickedBtnBrowse();

public:
	afx_msg void	OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void	OnSysCommand(UINT nID, LPARAM lParam);
};
